package com.wpt.main.servlet;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 *  BaseServlet
 *  @author  xinqh
 *  @Date    2011-3-31 下午12:03:16
 */
public abstract class BaseServlet extends HttpServlet {
	
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		doPost(request,response);
	}

	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		response.setContentType("text/xml");
		response.setHeader("Content-disposition", "inline; filename=treeXml.xml");
		response.setCharacterEncoding("utf-8");
		
		operator(request,response);
	}
	
	protected abstract void operator(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException;
	
}
